package z.explorer.ui.component.navigator;

import javax.swing.*;

import z.explorer.storage.Management;
import z.explorer.storage.Monitor;
import z.explorer.storage.TableViewer;
import z.explorer.task.TaskViewer;

public class ZNavigator extends JTabbedPane {

	private static final long serialVersionUID = 6916724478044302266L;
	private ZTree tree = null;

	public ZNavigator() {
		initTree();
		JScrollPane sp = new JScrollPane(tree,
				JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
				JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		this.add("Navigator", sp);
	}

	public void initTree() {
		ZTreeNode root = new ZTreeNode("application");
		ZTreeNode storage = new ZTreeNode("storage management");
		ZTreeNode management = new ZTreeNode("management",new Management());
		ZTreeNode monitor = new ZTreeNode("monitor",new Monitor());
		storage.add(monitor);
		storage.add(management);
		ZTreeNode task = new ZTreeNode("task management");
		ZTreeNode task_viewer = new ZTreeNode("taskViewer",new TaskViewer());
		task.add(task_viewer);
		root.add(storage);
		root.add(task);
		tree = new ZTree(root);
	}

}
